'''
Created on 05.02.2013

@author: p.hess
'''
import unittest
# from Renderer import Renderer
from Objects3D import Quad
from LinearSpreadGen import LinearSpread 
from LinearSpreadGen import SpreadType
from Transform import Transform

class Test(unittest.TestCase):


    def setUp(self):
        pass


    def tearDown(self):
        pass


    def testSimpleDisplay(self):
        
        # Create a static linear spread with 5 elements
        ls = LinearSpread( SpreadCount_in=5, SpreadType_in=SpreadType.Centered )
        t = Transform( translateX=None, translateY=[0], scaleX=[0.1], scaleY=[0.1] )
        q = Quad()
        # renderer = Renderer( displayX=0, displayY=0 )
        
        # this must be done in the main loop
        
        ls.update()
        print "LinearSpread.output: ", ls.output

        t.update(translateX=ls.output)
        print "Transform.transform_out: ", t.transform_out
        
        q.update(transform=t.transform_out)
        

        ls.update(SpreadCount_in=3)
        print "LinearSpread.output: ", ls.output

        t.update(translateX=ls.output)
        print "Transform.transform_out: ", t.transform_out
        
        q.update(transform=t.transform_out)

        ls.update(SpreadCount_in=5)
        print "LinearSpread.output: ", ls.output

        t.update(translateX=ls.output)
        print "Transform.transform_out: ", t.transform_out
        
        q.update(transform=t.transform_out)

        pass


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()